package com.ruoyi.blog.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName blog_user_info
 */
@TableName(value ="blog_user_info")
@Data
public class BlogUserInfo implements Serializable {
    /**
     * 主键 id
     */
    @TableId
    private Long id;

    /**
     * 用户 id
     */
    private Long userId;

    /**
     * 签名
     */
    private String signature;

    /**
     * 主页类型（全主页，半主页）
     */
    private Integer homePageTypes;

    /**
     * 主页（照片为 0 ，视频为 1）地址需要查询文件系统
     */
    private Integer urlType;

    /**
     * 头像框 id
     */
    private Long avatarBorderId;

    /**
     * 用户类型 （0 普通用户, 1 vip）
     */
    private Integer userType;

    /**
     * 0 —— 20 等级
     */
    private Integer userLever;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BlogUserInfo other = (BlogUserInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getSignature() == null ? other.getSignature() == null : this.getSignature().equals(other.getSignature()))
            && (this.getHomePageTypes() == null ? other.getHomePageTypes() == null : this.getHomePageTypes().equals(other.getHomePageTypes()))
            && (this.getUrlType() == null ? other.getUrlType() == null : this.getUrlType().equals(other.getUrlType()))
            && (this.getAvatarBorderId() == null ? other.getAvatarBorderId() == null : this.getAvatarBorderId().equals(other.getAvatarBorderId()))
            && (this.getUserType() == null ? other.getUserType() == null : this.getUserType().equals(other.getUserType()))
            && (this.getUserLever() == null ? other.getUserLever() == null : this.getUserLever().equals(other.getUserLever()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getSignature() == null) ? 0 : getSignature().hashCode());
        result = prime * result + ((getHomePageTypes() == null) ? 0 : getHomePageTypes().hashCode());
        result = prime * result + ((getUrlType() == null) ? 0 : getUrlType().hashCode());
        result = prime * result + ((getAvatarBorderId() == null) ? 0 : getAvatarBorderId().hashCode());
        result = prime * result + ((getUserType() == null) ? 0 : getUserType().hashCode());
        result = prime * result + ((getUserLever() == null) ? 0 : getUserLever().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", signature=").append(signature);
        sb.append(", homePageTypes=").append(homePageTypes);
        sb.append(", urlType=").append(urlType);
        sb.append(", avatarBorderId=").append(avatarBorderId);
        sb.append(", userType=").append(userType);
        sb.append(", userLever=").append(userLever);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}